function requestPage(pageNumber, itemsPerPage, itemsCount) {
	new Ajax.Request('/products.json', {
		method : 'get',
		parameters: {page: pageNumber, per_page: itemsPerPage, count: itemsCount},
		onSuccess : function(transport) {
			var response = transport.responseText || "no response text";
			var json = response.evalJSON();
			drawProducts(json);
			drawPager(json.page, json.itemsPerPage, json.count);
		},
		onFailure : function() {

		}
	});
}

/**
 * Draw product list using info received from the server in JSON format
 * @param json
 */
function drawProducts(json){
	var div = $('products');
	div.innerHTML='';
	for(var i=0;i<json.products.length;i++){
		var row;
		if(i%4==0){
			if(row){
				div.appendChild(row);
			}
			row = document.createElement('div');
			row.addClassName('product_row');
		}
		var product = document.createElement('div');
		product.addClassName('product');
		//ADD IMAGE
		var image = document.createElement('img');
		image.setAttribute('src','/images/'+json.products[i].imageName);
		image.addClassName('product_thumbnail');
		product.appendChild(image);
		//ADD TITLE
		var title = document.createElement('div');
		title.addClassName('title');
		title.innerHTML = json.products[i].name;
		product.appendChild(title);
		//ADD SHORT DESCRIPTION
		var shortDescription = document.createElement('div');
		shortDescription.addClassName('short_desc');
		shortDescription.innerHTML = json.products[i].shortDescription;
		product.appendChild(shortDescription);
		//ADD NEW PRICE
		var newPrice = document.createElement('div');
		newPrice.addClassName('new_price');
		newPrice.innerHTML = json.products[i].newPrice + ' грн';
		product.appendChild(newPrice);
		row.appendChild(product);
	}
}